<%@page import="com.office.automate.configuration.property.DatagridPageConfiguration"%>
<%@page import="com.office.automate.model.leave.LeaveRequest"%>
<%@page import="com.office.automate.service.def.leave.EmployeeLeaveService"%>
<%@page import="com.office.automate.service.impl.leave.EmployeeLeaveServiceImplementer"%>
<%@page import="com.office.automate.model.leave.EmployeeLeave"%>
<%@page import="com.office.automate.configuration.property.ConfigurationProperties"%>
<%@page import="java.util.Properties"%>
<%@page import="java.util.List"%>
<%@page import="com.office.automate.frontier.utility.DataConversionUtility"%>
<%@page import="java.util.Calendar"%>
<%@page import="com.office.automate.frontier.utility.ExceptionMessagesManagement"%>
<%@page import="com.office.automate.validation.framework.ValidatorObject"%>
<%@page import="com.office.automate.exception.framework.FrontierVisibleException"%>
<%@page import="java.util.HashMap"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@ include file="../common/CommonHeaderInfo.jsp"%>
<title>Approve Leave</title>
</head>
<body>
	<%@ include file="../common/SiteHeaderSection.jsp" %>
	<%@ include file="../common/LeaveManagementMenu.jsp"%>

		<%
			if (currentUser == null) {
				return;
			}
			Properties configSeqPropspg = ConfigurationProperties.getProps(); 
			Utility utilpg = new Utility(currentUser.getSecurityLevels());
			if (!utilpg.isFunctionalSecurityAllow(configSeqPropspg.getProperty("MAIN_LEAVE_MANAGEMENT")) ||  
						!utilpg.isFunctionalSecurityAllow(configSeqPropspg.getProperty("APPROVE_LEAVE")))  {
				response.sendRedirect("/OfficeAutomation/jsp/HomePage.jsp");
			}
			String aDataGridPageID = DatagridPageConfiguration.EMPLOYEE_LEAVE_APPROVE;
			String aNextDataRowNumber = (String)request.getAttribute("NextDataRowNumber");
			long loggedInUserId = 0;
			if (currentUser != null) {
				loggedInUserId= currentUser.getEmployeeId();			
			}
		%>
		<tr>
			<td colspan="3"><center><font class="formtablecaption"><u>Employee Leave Requests Approval</u></font></center><br /></td>
		</tr>
		<tr>
			<td>
				<center>
				        <jsp:include page="../frameworks/DataGridComponent.jsp">
			            	<jsp:param name="aDataGridPageID" value="<%=aDataGridPageID %>" />
			            	<jsp:param name="aNextRowNumber" value="<%=aNextDataRowNumber %>" />
			            	<jsp:param name="aCurrentUser" value="<%=loggedInUserId %>" />
			            	<jsp:param name="aButtonUpdateCaption" value="Approve" />
			            	<jsp:param name="aButtonDeleteCaption" value="Reject" />
			            	<jsp:param name="aButtonsNextPrevious" value="true" />
			        	</jsp:include>
				</center>
			</td>
		</tr>
				<tr>
			<td height="20px">
			
			</td>
		</tr>
<%@ include file="../common/SiteFotterSection.jsp" %>
</body>
</html>